package com.example.product.dao.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("category")
public class Category {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField("product_id")
    private Long productId;
    @TableField("category_code")
    Integer categoryCode;
}

//CREATE TABLE `category` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
//    `product_id` BIGINT NOT NULL COMMENT '关联产品ID',
//    `category_code` INT NOT NULL COMMENT '分类编码',
//    PRIMARY KEY (`id`),
//    INDEX `idx_product` (`product_id`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品分类表';